/*
 * 软件版权: 恒生电子股份有限公司
 * 修改记录:
 * 修改日期     修改人员  修改说明
 * ========    =======  ============================================
 * 2021/4/9  lisy31662  新增
 * ========    =======  ============================================
 */
package com.sansi.pencilbook.mapper;

import com.sansi.pencilbook.entity.AmtAccount;
import org.apache.ibatis.annotations.*;

import java.sql.SQLException;
import java.util.List;

/**
 * 功能说明: 资金表的增删改查
 *
 * @author lisy31662
 */
@Mapper
public interface AmtAccountMapper {

  @Insert("insert into amt_account (user_id, amt) value (#{userId}, #{amt})")
  public int saveAmtAccount(AmtAccount amtAccount) throws SQLException;

  @Select("select account_id, user_id, amt from amt_account")
  public List<AmtAccount> findAmtAccountAll() throws SQLException;

  @Select("select account_id, user_id, amt from amt_account where user_id=#{userId}")
  public AmtAccount findAmtAccountByUser(int userId) throws SQLException;

  @Select("select account_id, user_id, amt from amt_account where account_id=#{accountId}")
  public AmtAccount findAmtAccountByAccout(int accountId) throws SQLException;

  @Update("update amt_account set amt=#{amt} where account_id=#{accountId}")
  public int updateAmtAccount(AmtAccount amtAccount) throws SQLException;

  @Delete("delete from amt_account where account_id=#{accountId}")
  public int deleteAmtAccount(AmtAccount amtAccount) throws SQLException;

}

